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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.p: D = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.p: D = None
        self.txt = txt

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

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

f.t = j
f.s = j
f.w = h
f.p = b
g.t = f
g.o = h
h.y = e
h.q = f
h.x = g
a.r = e
l.u = f
l.p = a
e.y = h
e.q = h
e.w = g
e.r = g
e.v = b
e.t = a
j.u = f
j.p = a
b.y = h
b.q = h
b.w = g
b.r = g
b.v = e
b.t = a
assert g.o.q.w.q.p.txt == "b"