class A:
    def __init__(self, txt: str):
        self.r: G = None
        self.t: G = None
        self.u: D = None
        self.y: B = None
        self.o: E = None
        self.v: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: E = None
        self.u: B = None
        self.v: A = None
        self.q: G = None
        self.y: B = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: E = None
        self.o: F = None
        self.t: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: G = None
        self.t: B = None
        self.x: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: D = None
        self.q: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.z: E = None
        self.o: A = None
        self.s: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: A = None
        self.txt = txt

i = A("i")
b = B("b")
l = C("l")
g = D("g")
d = E("d")
h = F("h")
k = G("k")
m = B("m")

i.r = k
i.t = k
i.u = g
i.y = b
i.o = d
i.v = h
b.x = d
b.u = m
b.y = m
b.v = i
b.q = k
l.p = d
l.o = h
l.t = i
g.y = k
g.x = k
g.t = m
d.s = g
d.q = h
h.p = k
h.s = k
h.z = d
h.o = i
k.o = i
m.x = d
m.u = b
m.y = b
m.v = i
m.q = k
assert g.y.o.o.s.txt == "
class A:
    def __init__(self, txt: str):
        self.r: G = None
        self.t: G = None
        self.u: D = None
        self.y: B = None
        self.o: E = None
        self.v: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: E = None
        self.u: B = None
        self.v: A = None
        self.q: G = None
        self.y: B = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: E = None
        self.o: F = None
        self.t: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: G = None
        self.t: B = None
        self.x: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: D = None
        self.q: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.z: E = None
        self.o: A = None
        self.s: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: A = None
        self.txt = txt

i = A("i")
b = B("b")
l = C("l")
g = D("g")
d = E("d")
h = F("h")
k = G("k")
m = B("m")

i.r = k
i.t = k
i.u = g
i.y = b
i.o = d
i.v = h
b.x = d
b.u = m
b.y = m
b.v = i
b.q = k
l.p = d
l.o = h
l.t = i
g.y = k
g.x = k
g.t = m
d.s = g
d.q = h
h.p = k
h.s = k
h.z = d
h.o = i
k.o = i
m.x = d
m.u = b
m.y = b
m.v = i
m.q = k
assert g.y.o.o.s.txt == "g"