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

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

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

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

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

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

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

i.p = g
i.y = l
l.y = i
l.t = f
f.x = d
f.v = d
d.w = e
d.v = i
d.y = f
h.s = f
h.u = f
h.z = d
h.o = d
h.w = i
e.z = g
g.y = i
g.t = f
j.y = i
j.t = f
assert h.u.x.y.txt == "
class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.y: B = None
        self.txt = txt

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

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

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

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

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

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

i.p = g
i.y = l
l.y = i
l.t = f
f.x = d
f.v = d
d.w = e
d.v = i
d.y = f
h.s = f
h.u = f
h.z = d
h.o = d
h.w = i
e.z = g
g.y = i
g.t = f
j.y = i
j.t = f
assert h.u.x.y.txt == "f"