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

class B:
    def __init__(self, txt: str):
        self.w: C = None
        self.q: C = None
        self.txt = txt

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

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

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

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

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

m.y = e
m.x = b
n.w = b
n.q = b
b.y = e
h.p = n
d.p = j
d.u = j
d.y = b
d.r = b
d.t = n
d.z = n
e.r = n
e.z = c
e.v = c
e.u = m
e.q = j
c.p = j
c.y = b
c.r = b
c.u = m
c.t = n
c.z = n
j.y = e
j.x = b
assert n.w.y.v.r.txt == "
class A:
    def __init__(self, txt: str):
        self.y: F = None
        self.x: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: C = None
        self.q: C = None
        self.txt = txt

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

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

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

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

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

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