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

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

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

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

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

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

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

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

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

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

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

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

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

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

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