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

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.y: A = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: F = None
        self.w: C = None
        self.s: F = None
        self.v: A = None
        self.txt = txt

c = A("c")
k = B("k")
m = C("m")
j = D("j")
n = E("n")
a = F("a")
b = E("b")
d = F("d")
i = B("i")

c.y = n
c.x = i
c.q = m
k.r = c
k.y = c
m.p = k
m.w = i
m.x = a
m.y = b
j.r = k
n.y = b
n.z = b
n.x = m
n.v = j
n.p = c
n.o = a
a.u = d
a.s = d
a.w = m
a.v = c
b.y = n
b.z = n
b.x = m
b.v = j
b.p = c
b.o = a
d.u = a
d.s = a
d.w = m
d.v = c
i.r = c
i.y = c
assert b.o.u.v.q.w.r.q.y.txt == "
class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.x: B = None
        self.q: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.y: A = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: F = None
        self.w: C = None
        self.s: F = None
        self.v: A = None
        self.txt = txt

c = A("c")
k = B("k")
m = C("m")
j = D("j")
n = E("n")
a = F("a")
b = E("b")
d = F("d")
i = B("i")

c.y = n
c.x = i
c.q = m
k.r = c
k.y = c
m.p = k
m.w = i
m.x = a
m.y = b
j.r = k
n.y = b
n.z = b
n.x = m
n.v = j
n.p = c
n.o = a
a.u = d
a.s = d
a.w = m
a.v = c
b.y = n
b.z = n
b.x = m
b.v = j
b.p = c
b.o = a
d.u = a
d.s = a
d.w = m
d.v = c
i.r = c
i.y = c
assert b.o.u.v.q.w.r.q.y.txt == "b"