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

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: F = None
        self.s: D = None
        self.t: A = None
        self.x: C = None
        self.v: F = None
        self.z: C = None
        self.txt = txt

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

g = A("g")
d = B("d")
b = C("b")
k = D("k")
j = E("j")
h = F("h")
m = D("m")
a = F("a")
f = B("f")

g.s = j
d.t = b
d.p = g
b.y = d
b.q = f
b.p = k
k.s = a
k.o = m
k.z = g
j.q = a
j.v = a
j.s = k
j.t = g
j.x = b
j.z = b
h.r = m
h.z = m
h.v = d
h.s = j
h.y = g
h.t = f
m.s = a
m.o = k
m.z = g
a.r = k
a.v = d
a.z = m
a.s = j
a.y = g
a.t = f
f.t = b
f.p = g
assert g.s.q.s.z.q.t.q.t.txt == "
class A:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: F = None
        self.s: D = None
        self.t: A = None
        self.x: C = None
        self.v: F = None
        self.z: C = None
        self.txt = txt

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

g = A("g")
d = B("d")
b = C("b")
k = D("k")
j = E("j")
h = F("h")
m = D("m")
a = F("a")
f = B("f")

g.s = j
d.t = b
d.p = g
b.y = d
b.q = f
b.p = k
k.s = a
k.o = m
k.z = g
j.q = a
j.v = a
j.s = k
j.t = g
j.x = b
j.z = b
h.r = m
h.z = m
h.v = d
h.s = j
h.y = g
h.t = f
m.s = a
m.o = k
m.z = g
a.r = k
a.v = d
a.z = m
a.s = j
a.y = g
a.t = f
f.t = b
f.p = g
assert g.s.q.s.z.q.t.q.t.txt == "b"