class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

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

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

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

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

h.o = f
m.y = c
m.w = c
m.q = g
m.u = f
m.r = n
m.v = n
i.v = g
i.p = j
c.p = i
c.y = i
c.r = j
c.s = j
f.u = m
f.z = n
f.w = i
j.w = g
b.o = f
n.w = m
g.y = c
g.w = c
g.q = m
g.u = f
g.r = n
g.v = j
assert n.w.y.y.v.u.txt == "f"