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

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

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

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

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

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

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

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

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

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

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

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

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

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

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