class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.p: D = None
        self.v: C = None
        self.w: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.p: F = None
        self.q: B = None
        self.v: B = None
        self.z: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: C = None
        self.v: F = None
        self.y: D = None
        self.z: E = None
        self.x: B = None
        self.s: E = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.p: F = None
        self.q: B = None
        self.v: B = None
        self.z: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: C = None
        self.v: F = None
        self.y: D = None
        self.z: E = None
        self.x: B = None
        self.s: E = None
        self.txt = txt

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

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

c.y = d
c.p = i
c.v = b
c.w = e
d.q = c
d.z = j
b.y = c
b.r = d
i.p = n
i.q = d
i.v = d
i.z = d
m.q = b
m.v = n
m.y = i
m.z = j
m.s = j
m.x = d
g.t = m
e.q = b
e.v = g
e.y = i
e.z = j
e.s = j
e.x = d
n.t = e
j.q = b
j.v = n
j.y = i
j.z = m
j.s = m
j.x = d
assert c.v.y.w.q.txt == "b"