class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.w: D = None
        self.u: B = None
        self.s: F = None
        self.x: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: A = None
        self.s: E = None
        self.y: F = None
        self.x: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.r: B = None
        self.z: A = None
        self.p: E = None
        self.u: E = None
        self.x: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: B = None
        self.u: A = None
        self.r: A = None
        self.v: D = None
        self.s: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: C = None
        self.r: F = None
        self.y: E = None
        self.txt = txt

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

j.t = c
j.x = c
j.w = k
j.u = l
j.s = f
c.p = j
c.s = g
c.x = g
c.y = f
b.q = k
b.r = l
b.z = j
b.x = j
b.p = g
b.u = g
k.t = c
g.q = l
g.u = j
g.r = j
g.v = k
g.s = b
i.z = b
i.r = f
i.y = g
f.z = b
f.r = i
f.y = g
l.p = j
l.s = g
l.x = g
l.y = f
assert g.q.y.r.y.r.w.t.txt == "
class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.w: D = None
        self.u: B = None
        self.s: F = None
        self.x: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: A = None
        self.s: E = None
        self.y: F = None
        self.x: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.r: B = None
        self.z: A = None
        self.p: E = None
        self.u: E = None
        self.x: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: B = None
        self.u: A = None
        self.r: A = None
        self.v: D = None
        self.s: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: C = None
        self.r: F = None
        self.y: E = None
        self.txt = txt

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

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