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

class B:
    def __init__(self, txt: str):
        self.u: E = None
        self.t: F = None
        self.v: F = None
        self.y: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: F = None
        self.p: A = None
        self.v: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: B = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.u: E = None
        self.t: F = None
        self.v: F = None
        self.y: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: F = None
        self.p: A = None
        self.v: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: B = None
        self.txt = txt

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

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

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