class A:
    def __init__(self, txt: str):
        self.z: C = None
        self.y: C = None
        self.u: B = None
        self.t: D = None
        self.o: C = None
        self.w: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: G = None
        self.t: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: G = None
        self.y: F = None
        self.o: A = None
        self.t: A = None
        self.w: B = None
        self.s: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: G = None
        self.w: F = None
        self.u: B = None
        self.z: D = None
        self.q: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: E = None
        self.x: C = None
        self.v: D = None
        self.w: D = None
        self.o: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.u: G = None
        self.t: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: G = None
        self.y: F = None
        self.o: A = None
        self.t: A = None
        self.w: B = None
        self.s: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: G = None
        self.w: F = None
        self.u: B = None
        self.z: D = None
        self.q: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: E = None
        self.x: C = None
        self.v: D = None
        self.w: D = None
        self.o: F = None
        self.txt = txt

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

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