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

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

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.r: E = None
        self.z: F = None
        self.s: D = None
        self.p: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.x: D = None
        self.txt = txt

g = A("g")
j = B("j")
d = C("d")
c = D("c")
f = E("f")
i = F("i")
n = F("n")
l = F("l")
h = E("h")

g.u = c
g.r = n
g.x = d
g.y = d
g.z = f
j.u = d
j.q = d
j.t = c
d.w = n
d.z = n
d.r = f
d.s = c
d.p = g
c.x = j
c.q = j
c.r = d
f.u = d
f.q = j
f.x = j
i.x = c
n.x = c
l.x = c
h.u = d
h.q = j
h.x = j
assert g.y.p.u.q.u.txt == "
class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.r: F = None
        self.x: C = None
        self.y: C = None
        self.z: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.r: E = None
        self.z: F = None
        self.s: D = None
        self.p: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.x: D = None
        self.txt = txt

g = A("g")
j = B("j")
d = C("d")
c = D("c")
f = E("f")
i = F("i")
n = F("n")
l = F("l")
h = E("h")

g.u = c
g.r = n
g.x = d
g.y = d
g.z = f
j.u = d
j.q = d
j.t = c
d.w = n
d.z = n
d.r = f
d.s = c
d.p = g
c.x = j
c.q = j
c.r = d
f.u = d
f.q = j
f.x = j
i.x = c
n.x = c
l.x = c
h.u = d
h.q = j
h.x = j
assert g.y.p.u.q.u.txt == "d"