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

class B:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.r: D = None
        self.v: D = None
        self.x: F = None
        self.t: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: G = None
        self.u: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.r: B = None
        self.z: D = None
        self.q: C = None
        self.t: G = None
        self.txt = txt

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

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

c = A("c")
a = B("a")
i = C("i")
f = D("f")
j = E("j")
g = F("g")
l = G("l")

c.w = l
c.y = l
c.u = j
c.q = j
a.x = j
i.q = f
i.r = f
i.v = f
i.t = f
i.x = g
f.w = l
f.u = c
j.y = f
j.z = f
j.r = a
j.q = i
j.t = l
g.w = c
g.x = i
g.p = j
g.t = a
g.v = a
g.o = l
l.x = j
l.u = g
assert a.x.t.u.x.t.u.txt == "
class A:
    def __init__(self, txt: str):
        self.w: G = None
        self.u: E = None
        self.q: E = None
        self.y: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.r: D = None
        self.v: D = None
        self.x: F = None
        self.t: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: G = None
        self.u: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.r: B = None
        self.z: D = None
        self.q: C = None
        self.t: G = None
        self.txt = txt

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

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

c = A("c")
a = B("a")
i = C("i")
f = D("f")
j = E("j")
g = F("g")
l = G("l")

c.w = l
c.y = l
c.u = j
c.q = j
a.x = j
i.q = f
i.r = f
i.v = f
i.t = f
i.x = g
f.w = l
f.u = c
j.y = f
j.z = f
j.r = a
j.q = i
j.t = l
g.w = c
g.x = i
g.p = j
g.t = a
g.v = a
g.o = l
l.x = j
l.u = g
assert a.x.t.u.x.t.u.txt == "c"